package com.huijutao.beans;

import android.text.TextUtils;

import com.alibaba.fastjson.JSON;

import org.json.JSONException;
import org.json.JSONObject;

import java.io.Serializable;
import java.util.List;

/**
 * 发现页面的bean
 */
public class FindItem implements Serializable{
    private String id;
    private String title;
    private String price;
    private String go_url;
    private String intro;
    private int width480;
    private int height480;
    private String img_path480;
    private String img_path;
    private String time;

    public static List<FindItem> getListFromJsonStr(String jsonStr) {
        try {
            JSONObject jsonObject = new JSONObject(jsonStr);
            if ("ok".equals(jsonObject.optString("msg")) &&
                    !TextUtils.isEmpty(jsonObject.optString("data"))) {
                return JSON.parseArray(jsonObject.optString("data"), FindItem.class);
            }
        } catch (JSONException e) {
            e.printStackTrace();
        }
        return null;
    }

    public int getWidth480() {
        return width480;
    }

    public void setWidth480(int width480) {
        this.width480 = width480;
    }

    public int getHeight480() {
        return height480;
    }

    public void setHeight480(int height480) {
        this.height480 = height480;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getPrice() {
        return price;
    }

    public void setPrice(String price) {
        this.price = price;
    }

    public String getGo_url() {
        return go_url;
    }

    public void setGo_url(String go_url) {
        this.go_url = go_url;
    }

    public String getIntro() {
        return intro;
    }

    public void setIntro(String intro) {
        this.intro = intro;
    }

    public String getImg_path480() {
        return img_path480;
    }

    public void setImg_path480(String img_path480) {
        this.img_path480 = img_path480;
    }

    public String getImg_path() {
        return img_path;
    }

    public void setImg_path(String img_path) {
        this.img_path = img_path;
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }
}
